package com.sc.nft.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.RoughStoneOrder;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.vo.CreateOrderVO;
import com.sc.nft.entity.vo.OrderDetailsVO;
import com.sc.nft.entity.vo.RoughStoneOrderVO;
import com.sc.nft.enums.ClassifyType;
import com.sc.nft.enums.OrderStatusEnum;
import com.sc.nft.exception.GlobalException;

import java.util.Date;
import java.util.List;

/**
 * 原始订单表服务接口
 *
 * @author zxy
 * @description 汇付相关
 * @since 2023-08-14 16:40:43
 */
public interface RoughStoneOrderService {
    /**
     * 支付回调
     *
     * @param order
     */
    void paySuccess(RoughStoneOrder order) ;

    Page<RoughStoneOrder> orderPage(UserInfo userInfo, OrderStatusEnum orderStatus, Integer pageNo, Integer pageSize);

    /**
     * 根据订单号查询订单信息
     *
     * @param orderNo
     * @return
     */
    CreateOrderVO findRoughStoneOrderByOrderNo(String orderNo);

    /**
     * 关闭订单
     *
     * @param id
     */
    void closeOrder(Long id) throws GlobalException;

    /**
     * 订单详情
     *
     * @param id
     * @return
     */
    OrderDetailsVO getRoughStoneOrderDetailsById(Long id);

    List<RoughStoneOrder> getCloseOrder();

    void autoCloseOrder(RoughStoneOrder order) throws GlobalException;

    /**
     * 管理端原石订单
     *
     * @return 原石订单分页对象
     */
    Page<RoughStoneOrderVO> orderPageFromAdmin(String orderNo, OrderStatusEnum status, ClassifyType typeClassify, Date startOrderTime, Date endOrderTime, Date startPayTime, Date endPayTime, String userTel, int pageNo, int pageSize);

    /**
     * 获取所有订单数据
     */
    List<RoughStoneOrderVO> roughStoneOrderExcel(String orderNo, OrderStatusEnum status, ClassifyType typeClassify, Date startOrderTime, Date endOrderTime, Date startPayTime, Date endPayTime, String userTel);


    Integer countRoughStoneOrder(Long userId);
}
